package com.jbpm.wf.action;

import javax.annotation.Resource;

import net.sf.json.JSONObject;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.jbpm.action.BaseAction;
import com.jbpm.util.JsonBuilder;
import com.jbpm.wf.service.WfInfoManager;
@Component("wfInfoAction")
@Scope("prototype")
public class WfInfoAction extends BaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = -8405023035416585631L;
	private WfInfoManager wfInfoManager;
	private String modelName;
	private String idName;
	private String idValue;
	public void loadInfo(){
		JSONObject returnObj=new JSONObject();
		wfInfoManager.loadInfo(modelName, idName,idValue, returnObj);
		toWrite(JsonBuilder.getInstance().returnSuccessJson(JsonBuilder.getInstance().toJson(returnObj)));
	}
	@Override
	public Object getModel() {
		// TODO Auto-generated method stub
		return null;
	}
	@Resource(name="wfInfoManager")
	public void setWfInfoManager(WfInfoManager wfInfoManager) {
		this.wfInfoManager = wfInfoManager;
	}
	public String getModelName() {
		return modelName;
	}
	public void setModelName(String modelName) {
		this.modelName = modelName;
	}
	public String getIdName() {
		return idName;
	}
	public void setIdName(String idName) {
		this.idName = idName;
	}
	public String getIdValue() {
		return idValue;
	}
	public void setIdValue(String idValue) {
		this.idValue = idValue;
	}
	
}
